home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.cs.arizona.edu
/
ftp.cs.arizona.edu.tar
/
ftp.cs.arizona.edu
/
icon
/
newsgrp
/
group97b.txt
/
000124_icon-group-sender _Mon Nov 24 08:30:50 1997.msg
< prev
next >
Wrap
Internet Message Format
|
2000-09-20
|
2KB
Return-Path: <icon-group-sender>
Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239])
by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id IAA20025
for <icon-group-addresses@baskerville.CS.Arizona.EDU>; Mon, 24 Nov 1997 08:30:49 -0700 (MST)
Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM)
id AA07618; Mon, 24 Nov 1997 08:30:49 -0700
From: Mike D Cross <crossmd@mh.uk.sbphrd.com>
Message-Id: <199711221443.OAA03592@heu534.ha.uk.sbphrd.com>
X-Authentication-Warning: heu534.ha.uk.sbphrd.com: localhost [127.0.0.1] didn't use HELO protocol
To: icon-group@optima.CS.Arizona.EDU
Cc: crossmd@mh.uk.sbphrd.com
Subject: Question - How to extract data from a formatted line.
Date: Sat, 22 Nov 97 14:43:22 +0000
X-Mts: smtp
Errors-To: icon-group-errors@optima.CS.Arizona.EDU
Status: RO
Hi,
I've been given some Perl programs which extract data from lines
of text, each line being of a set format. In perl you do:
@dumpline = /^RLOGNAME=\"(.*)\" UID=\"(.*)\" GID=\"(.*)\" PROFILE=\"(.*)\"
REALNAME=\"(.*)\" HOMEDIR=\"(.*)\" USERLASTCHANGE=\"(.*)\" FLAGS=\"(.*)\"
PSW=\"(.*)\" PSWLASTCHANGE=\"(.*)\" NO_PWDF=\"(.*)\" SERIAL=\"(.*)\"
PSWKEY=\"(.*)\" LASTTTY=\"(.*)\" LASTLOGIN=\"(.*)\" LASTLOGOUT=\"(.*)\"
RETRY=\"(.*)\" RESERVED1=\"(.*)\" RESERVED2=\"(.*)\" LOGINVALIDTIME=\"(.*)\"
PSWVALIDTIME=\"(.*)\" CHPSWTIME=\"(.*)\" PSWMINLEN=\"(.*)\" PSWFORCE=\"(.*)\"
PSWHISTLEN=\"(.*)\" CHPSWFREQ=\"(.*)\" TIMEOUT=\"(.*)\" TTIMEOUT=\"(.*)\"
TDAYS=\"(.*)\" TSTART=\"(.*)\" TEND=\"(.*)\" RETRYMAX=\"(.*)\"
CONCUR_LOGINS=\"(.*)\" SHELL=\"(.*)\" PARAMETERMASK=\"(.*)\".*$/;
which generates an array (dumpline) which contains all the text
which matched the pattern \"(.*)\"
The input file contains about 20 different format lines, I'm
not a fan of Perl and would like to re-write the programs in
Icon, but I need some hints on the best method.
Thanks in advance
Mike
=============================================================
Mike Cross
Principal Analyst
UNIX Systems
SmithKline Beecham
New Frontiers Science Park (South)
Third Avenue, Harlow,
CM19 5AW email: crossmd@mh.uk.sbphrd.com